# from selenium.webdriver.common.by import By
# import time
# from selenium import webdriver
# d = webdriver.Chrome()
# d.get('http://192.168.0.125:9009/')
# d.maximize_window()
# time.sleep(2)
# write_ele = d.find_element(By.CSS_SELECTOR, '[id="new_role2"]')
# time.sleep(2)
# write_ele.click()
# time.sleep(2)
# bbb_ele = d.find_element(By.LINK_TEXT, '作者')
# time.sleep(2)
# bbb_ele.click()
# time.sleep(2)

# from selenium.webdriver.common.by import By
# import time
# from selenium import webdriver
# from selenium.webdriver import ActionChains
# d = webdriver.Chrome()
# d.get('https://www.baidu.com/')
# d.maximize_window()
# time.sleep(2)
# one_ele = d.find_element(By.CSS_SELECTOR, '[id="s-usersetting-top"]')
# ActionChains(d).move_to_element(one_ele).perform()
# time.sleep(2)
# two_ele = d.find_element(By.LINK_TEXT, '搜索设置')
# two_ele.click()
# time.sleep(2)
# one1_ele = d.find_element(By.LINK_TEXT, '保存设置')
# one1_ele.click()
# time.sleep(2)
# # 警告框处理  switch_to.alert
# msg = d.switch_to.alert.text # 获取警告框的文本
# time.sleep(2)
# # d.switch_to.alert.dismiss() # 关闭警告框
# d.switch_to.alert.accept() # 确认警告框
# time.sleep(2)
#
#
# d.get_screenshot_as_file('a.png')
# from selenium import webdriver
# from selenium.webdriver import Keys
# from selenium.webdriver.common.by import By
# import time
# d = webdriver.Chrome()
# d.get('http://192.168.0.125:9009/wp-login.php')
# d.maximize_window()
# time.sleep(1)
# input_ele = d.find_element(By.CSS_SELECTOR,'[id="user_login"]')
# time.sleep(1)
# # 使用键盘操作 导入 Keys 模块
# input_ele.send_keys('Python哈哈')
# time.sleep(1)
# input_ele.send_keys(Keys.BACK_SPACE) # 删除
# time.sleep(1)
# input_ele.send_keys(Keys.ENTER) # 回车
# time.sleep(1)
# time.sleep(10)
# d.quit()
#
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# # 显式等待 1、有条件的等待    2、 一次性
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC
# d = webdriver.Chrome()
# d.get('https://www.baidu.com')
# # [id="su"]
# wait = WebDriverWait(d, 10) # 等待时间
# # 等待 某个元素 可以被点击
# wait.until(EC.element_to_be_clickable( (By.CSS_SELECTOR, '[id="su"]') ))  # 一次性
# title_is 标题是某内容
# title_contains 标题包含某内容
# presence_of_element_located 元素加载出，传入定位元组，如(By.ID, 'p')
# visibility_of_element_located 元素可见，传入定位元组
# visibility_of 可见，传入元素对象
# presence_of_all_elements_located 所有元素加载出
# text_to_be_present_in_element 某个元素文本包含某文字
# text_to_be_present_in_element_value 某个元素值包含某文字
# frame_to_be_available_and_switch_to_it frame加载并切换
# invisibility_of_element_located 元素不可见
# element_to_be_clickable 元素可点击
# staleness_of 判断一个元素是否仍在DOM，可判断页面是否已经刷新
# element_to_be_selected 元素可选择，传元素对象
# element_located_to_be_selected 元素可选择，传入定位元组
# element_selection_state_to_be 传入元素对象以及状态，相等返回True，否则返回False
# element_located_selection_state_to_be 传入定位元组以及状态，相等返回True，否则返回False
# alert_is_present 是否出现Alert

# wordpress_project
# 基础层：封装所有的通用操作(打开浏览器、打开网页、输入、点击...)
# 页面层：针对不同的页面，存储该页面的定位元素，调用基础层
# 用例层：不同功能用例，具体操作是什么样子的
# 数据层：同一个功能的用例，使用的数据可能不一样，但是操作都一样
# 报告层：生成测试报告
